package cate.common.table.item.rune.sheet;

import cate.common.table.ESheet;
import cate.common.table.item.rune.row.RuneSkillRow;
import easy.java.dev.note.NoteClass;

import java.util.List;
import java.util.stream.Collectors;


@NoteClass(value = "符文技能表")
public class RuneSkillSheet extends ESheet<RuneSkillRow> {

    @Override
    public String getSheetName() {
        return "徽章技能";
    }

    @Override
    public RuneSkillRow buildRow() {
        return new RuneSkillRow();
    }

    public boolean existSkill(int skillId, int group) {
        for (RuneSkillRow row : this.getList()) {
            if (row.skillId == skillId && row.groupId == group) {
                return true;
            }
        }
        return false;
    }

    public List<Integer> getSkillsByGroups(List<Integer> groups){
        return this.getList().stream().filter(e -> groups.contains(e.groupId)).map(e -> e.id).collect(Collectors.toList());
    }
}
